package dk.au.cs.peterbn.annotations;

import spoon.reflect.declaration.CtAnnotation;

import java.lang.annotation.*;
import java.util.List;

/**
 * A list of member annotations
 */
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target(ElementType.METHOD)
public @interface Members {
    public enum Fields implements PropertyIdentifier {
        VALUE("value"),;
        private final String s;

        Fields(String s) {
            this.s = s;
        }

        @Override
        public String propName() {
            return s;
        }

        public static List<CtAnnotation<Member>> getValue(CtAnnotation<Members> annotation) {
            return (List<CtAnnotation<Member>>) annotation.getElementValues().get(VALUE.propName());
        }
    }
    Member[] value();
}
